<template>
    <div class="management">
       <div class="inner">
           <div class="title">
            <ul>
                <li>订单信息</li>
                <li>支付金额</li>
                <li>
                    <Dropdown @on-click="select">
                    <a href="javascript:void(0)">
                        状态
                        <Icon type="ios-arrow-down"></Icon>
                    </a>
                    <DropdownMenu slot="list">
                        <DropdownItem name="0">全部</DropdownItem>
                        <DropdownItem name="6">未评价</DropdownItem>
                        <DropdownItem name="7">已评价</DropdownItem>
                    </DropdownMenu>
                </Dropdown>
                </li>
                <li>操作</li>
            </ul>
        </div>
           <div class="conten">
               <div class="order-list">
                   <order-item :listinfo="i" v-for="i in list" :key="i.id"  :width="95" :status="1"></order-item>
               </div>
           </div>
       </div>
    </div>
</template>

<script>
    import OrderItem from '../../../components/ListItem/OrderItem'
    export default {
        name: "Management",
        components:{
            OrderItem
        },

        data () {
            return {
                list: [],
                selected:0
            }
        },
        created () {
            this.init()
        },
        methods :{
            init() {
                let _this = this
                _this.$post('/api/shop/myOrderPingList',
                    {
                        token:_this.$token,
                        status:_this.selected
                    },function (res) {
                        _this.list = res.data
                        _this.list.forEach(function (i) {
                            _this.$set(i,'type',2);
                            if(i.status == 6){
                                _this.$set(i,'text','待评价');

                            }else {
                              if(i.status == 7){
                                  _this.$set(i,'text','已评价');
                              }
                            }
                        })
                        console.log( _this.list)

                    },function (err,errmsg,errcode) {
                        _this.$message.error(errmsg);
                    }
                )
            },
            select (name) {
                this.selected = name
                this.init()
            }
        }
    }
</script>

<style scoped lang="less">
    @import "../../../style/style";
    .management{
        >.inner{
            width: 700px;
            height: 1286px;
            background-color: #ffffff;
            border: solid 1px #e0e0e0;
            border-top: none;
            /*padding:20px;*/
            >.title{
                width: 698px;
                height: 43px;
                background-color: #f5f5f5;
                border-bottom: solid 1px #e0e0e0;
                border-top: 2px solid @theme-color-dark;
                >ul{
                    >li{
                        float: left;
                        line-height: 43px;
                        text-align: center;
                        font-size: 12px;
                        color: #666666;
                        width: 15%;
                        a{
                            color:#666666 ;
                        }
                    }
                    >:first-child{
                        width: 50%;
                    }
                }
            }
            >.conten{
               padding: 0 13px 0 27px;

            }
        }
    }

</style>